From 697a75a8dd1e11ffc6451241bcc5f977046480ea Mon Sep 17 00:00:00 2001 From: Alastair Tse Date: Wed, 24 Jan 2007 13:54:37 +0000 Subject: [PATCH] [XEND] Prevent invalid arguments for destroy event channels. Signed-off-by: Alastair Tse --- tools/python/xen/xend/XendDomainInfo.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 0a5f039a0d..6696da4ab2 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1577,18 +1577,21 @@ class XendDomainInfo: """Create an event channel to the domain. """ try: - return xc.evtchn_alloc_unbound(domid=self.domid, remote_dom=0) + if self.domid != None: + return xc.evtchn_alloc_unbound(domid = self.domid, + remote_dom = 0) except: - log.exception("Exception in alloc_unbound(%d)", self.domid) + log.exception("Exception in alloc_unbound(%s)", str(self.domid)) raise def _resetChannels(self): """Reset all event channels in the domain. """ try: - return xc.evtchn_reset(dom=self.domid) + if self.domid != None: + return xc.evtchn_reset(dom = self.domid) except: - log.exception("Exception in evtcnh_reset(%d)", self.domid) + log.exception("Exception in evtcnh_reset(%s)", str(self.domid)) raise -- 2.30.2